package com.canyou.system.entity.user;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.canyou.datamask.Sensitive;
import com.canyou.datamask.SensitiveStrategy;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.time.ZonedDateTime;

/**
 * 用户列表模型
 *
 * @author fy
 * @date 2021/5/19 13:37
 */
@Data
@ApiModel(value = "UserListVO", description = "用户列表模型")
public class UserListVO {

    @ApiModelProperty(value = "主键id")
    private Long id;

    @Excel(name = "账号", orderNum = "0", width = 20)
    @ApiModelProperty("用户名")
    private String username;

    @ApiModelProperty("联系电话")
    @Sensitive(strategy = SensitiveStrategy.PHONE)
    @Excel(name = "手机", orderNum = "3", width = 20)
    private String mobile;

    @ApiModelProperty("生日")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private ZonedDateTime birthday;

    @ApiModelProperty("状态 0锁定 1有效")
    @Excel(name = "状态", replace = {"禁用_0", "启用_1"}, orderNum = "7", width = 15)
    private Integer status;

    @ApiModelProperty("性别 0未知1男 2女")
    @Excel(name = "性别", replace = {"男_1", "女_2", "_null"}, orderNum = "2", width = 15)
    private Integer sex;

    @ApiModelProperty("真实姓名")
    @Sensitive(strategy = SensitiveStrategy.USERNAME)
    @Excel(name = "姓名", orderNum = "1", width = 20)
    private String realName;

    @ApiModelProperty("部门名称")
    @Excel(name = "部门", orderNum = "5", width = 20)
    private String deptName;

    @ApiModelProperty("机构名称")
    @Excel(name = "组织", orderNum = "4", width = 20)
    private String orgName;

    @ApiModelProperty("角色名称（多个用逗号隔开）")
    @Excel(name = "角色", orderNum = "6", width = 20)
    private String roleName;

    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "创建时间", orderNum = "8", width = 25, exportFormat = "yyyy-MM-dd")
    private ZonedDateTime createTime;

}
